package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.VehicleBillMapper;
import com.ruoyi.order.domain.VehicleBill;
import com.ruoyi.order.service.IVehicleBillService;

/**
 * 消费记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class VehicleBillServiceImpl implements IVehicleBillService 
{
    @Autowired
    private VehicleBillMapper vehicleBillMapper;

    /**
     * 查询消费记录
     * 
     * @param id 消费记录主键
     * @return 消费记录
     */
    @Override
    public VehicleBill selectVehicleBillById(Long id)
    {
        return vehicleBillMapper.selectVehicleBillById(id);
    }

    /**
     * 查询消费记录列表
     * 
     * @param vehicleBill 消费记录
     * @return 消费记录
     */
    @Override
    public List<VehicleBill> selectVehicleBillList(VehicleBill vehicleBill)
    {
        return vehicleBillMapper.selectVehicleBillList(vehicleBill);
    }

    /**
     * 新增消费记录
     * 
     * @param vehicleBill 消费记录
     * @return 结果
     */
    @Override
    public int insertVehicleBill(VehicleBill vehicleBill)
    {
        vehicleBill.setCreateTime(DateUtils.getNowDate());
        return vehicleBillMapper.insertVehicleBill(vehicleBill);
    }

    /**
     * 修改消费记录
     * 
     * @param vehicleBill 消费记录
     * @return 结果
     */
    @Override
    public int updateVehicleBill(VehicleBill vehicleBill)
    {
        return vehicleBillMapper.updateVehicleBill(vehicleBill);
    }

    /**
     * 批量删除消费记录
     * 
     * @param ids 需要删除的消费记录主键
     * @return 结果
     */
    @Override
    public int deleteVehicleBillByIds(Long[] ids)
    {
        return vehicleBillMapper.deleteVehicleBillByIds(ids);
    }

    /**
     * 删除消费记录信息
     * 
     * @param id 消费记录主键
     * @return 结果
     */
    @Override
    public int deleteVehicleBillById(Long id)
    {
        return vehicleBillMapper.deleteVehicleBillById(id);
    }
}
